<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-zhGameInfo-edit" th:object="${zhGameInfo}">
            <input id="id" name="id" th:field="*{id}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">游戏名称：</label>
				<div class="col-sm-8">
					<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">是否热搜：</label>
				<div class="col-sm-8">
					<select id="ifHot" name="ifHot" class="form-control m-b" th:field="*{ifHot}">
						<option value="0">否</option>
						<option value="1">是</option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">是否热搜：</label>
				<div class="col-sm-8">
					<select id="ifRecommand" name="ifRecommand" class="form-control m-b" th:field="*{ifRecommand}">
						<option value="0">否</option>
						<option value="1">是</option>
					</select>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label">排序：</label>
				<div class="col-sm-8">
					<input id="sorting" name="sorting" th:field="*{sorting}" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">站点：</label>
				<div class="col-sm-8">
					<select id="deptId" name="deptId" class="form-control m-b" th:field="*{deptId}">
						<option th:each="zhDept:${zhDepts}" th:value="${zhDept.deptId}" th:text="${zhDept.name}" th:field="*{deptId}"></option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="remark" class="form-control" th:field="*{remark}"></textarea>
				</div>
			</div>

			<div class="form-group" style="display: none;">
				<label class="col-sm-3 control-label">logo链接：</label>
				<div class="col-sm-8">
					<input id="logo" name="logo" class="form-control img_upload" type="text">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">logo：</label>
				<button type="button" class="layui-btn upload" id="logo_upload" style="margin-left: 15px;">
					<i class="layui-icon">&#xe67c;</i>上传图片
				</button>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">logo预览：</label>
				<img id="logo_upload_preview" height="100" width="150" style="cursor: pointer;margin-left: 15px;" class="preview" th:src="${zhGameInfo.logo}" />
			</div>
		</form>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/zhGameInfo";
		$("#form-zhGameInfo-edit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/edit", $('#form-zhGameInfo-edit').serialize());
	        }
	    }
	</script>
	<script type="text/javascript">
		layui.use('upload', function(){
			var preview_img =$('#logo_upload_preview')
			preview_img.on("click",function(e){
				layer.photos({ photos: {"data": [{"src": e.target.src}]} });
			});
			var upload = layui.upload;
			var layer = layui.layer;
			//执行实例

			renderUpload(upload,$('#logo_upload'),preview_img,$('#logo'))
		});
	</script>


</body>
</html>
